<template>
  <div class="app">
    <h2>事件总线（mitt）一对多</h2>
    <h1>子组件的输入值：{{ childValue }}</h1>
    <mittetBusA></mittetBusA>
    <!-- <mittetBusB
      :modelValue="childValue"
      @update:modelValue="childValue = $event"
    ></mittetBusB> -->
    <mittetBusB v-model="childValue"></mittetBusB>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import mittetBusA from "./components/mittetBusA.vue";
import mittetBusB from "./components/mittetBusB.vue";

// 使用ref创建响应式数据
const childValue = ref("初始值");
</script>

<style scoped></style>
